package com.example.wallpaperapp.ui.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.wallpaperapp.R;
import com.example.wallpaperapp.base.BaseActivity;
import com.example.wallpaperapp.bean.FindPreviewBean;
import com.example.wallpaperapp.bean.HomeChoicBean;
import com.example.wallpaperapp.bean.Moment;
import com.example.wallpaperapp.utils.StatusBar;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import cn.bingoogolapple.baseadapter.BGAOnRVItemClickListener;
import cn.bingoogolapple.baseadapter.BGAOnRVItemLongClickListener;
import cn.bingoogolapple.photopicker.widget.BGANinePhotoLayout;

public class FindPreviewActivity extends BaseActivity implements BGAOnRVItemClickListener, BGAOnRVItemLongClickListener, BGANinePhotoLayout.Delegate{
    BGANinePhotoLayout ninePhotoLayout;
    List<FindPreviewBean> list;
    @BindView(R.id.find_preview_bar)
    TextView textView;
    @BindView(R.id.find_preview_username)
    TextView textView2;
    @BindView(R.id.find_preview_content)
    TextView textView3;
    @Override
    protected int initLayout() {
        return R.layout.activity_find_preview;
    }
    public static void startFindPreviewActivity(Context context, FindPreviewBean bean){
        Intent intent = new Intent(context,FindPreviewActivity.class);
        List<FindPreviewBean> list = new ArrayList<>();
        list.add(bean);
        Bundle bundle = new Bundle();
        bundle.putSerializable("datas", (Serializable) list);
        intent.putExtras(bundle);
        context.startActivity(intent);
    }

    @Override
    protected void initView() {
        LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)textView.getLayoutParams();
        layoutParams.height = StatusBar.getStatusBarHeight(this);
        textView.setLayoutParams(layoutParams);
        ninePhotoLayout = findViewById(R.id.npl_moment_photos);
    }
    @Override
    protected void initData() {
        list = new ArrayList<>();

        list = (List<FindPreviewBean>) getIntent().getSerializableExtra("datas");
        Log.e(TAG, "initView: "+list.get(0).getPhotos().size());
//        textView2.setText(bean.getUserName());
//        textView3.setText(bean.getContent());
    }

    @Override
    public void onRVItemClick(ViewGroup parent, View itemView, int position) {

    }
    @Override
    public boolean onRVItemLongClick(ViewGroup parent, View itemView, int position) {
        return false;
    }
    @Override
    public void onClickNinePhotoItem(BGANinePhotoLayout ninePhotoLayout, View view, int position, String model, List<String> models) {

    }
    @Override
    public void onClickExpand(BGANinePhotoLayout ninePhotoLayout, View view, int position, String model, List<String> models) {

    }
}